def bit_swap_count(a, b):
    if a < 0 or b < 0:
        raise Exception('非法输入')
    tmp = a ^ b
    ans = 0
    while tmp:
        tmp = (tmp - 1) & tmp
        ans += 1
    return ans


a = -8
b = 3
ans = bit_swap_count(a, b)
print(ans)
